package com.momomian.common.annotation;


import com.momomian.common.annotation.impl.DigitsMustInValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author momomian
 * @date 2020/10/22
 * @description 校验 值必须在指定 inArray 中   字段使用需要在引用时加@Valid注解
 *
 */
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = DigitsMustInValidator.class)
public @interface DigitsMustIn {

    String message()  default "{}不需在[{}]中";

    String inArray();

    /**
     * true只能传其中一个
     */
    boolean single() default false;

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
